const mysql = require('mysql');
const pool  = mysql.createPool({
    host     : 'localhost',
    user     : 'root',
    password : 'zcl',
    database: 'quxue',
    multipleStatements: true,
});

module.exports = {
    query:function(sql){
        return new Promise(function(resolve,reject){
            pool.query(sql,function(err,result){
                if(err){
                    reject(err)
                }else{
                    resolve(result)
                }
            })
        })
    }
}
